package cn.yfxu.controller;


import cn.yfxu.entity.Labels;
import cn.yfxu.service.ILabelsService;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.spring.web.json.Json;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yfxu
 * @since 2020-11-26
 */
@RestController
@RequestMapping("/labels")
public class LabelsController {
     @Autowired
    private ILabelsService iLabelsService;


    @RequestMapping(value = "/getone",method = RequestMethod.GET)
    public String getLabels(){
        String s="";
        Labels one = iLabelsService.getOne(new QueryWrapper<Labels>().lambda().eq(Labels::getId, 1));
         s = JSON.toJSONString(one);
        return  s;
    }
}
